package com.qst.mapper;

import com.github.pagehelper.Page;
import com.qst.domain.Book;
import org.apache.ibatis.annotations.*;

@Mapper
public interface BookMapper {


    Page<Book> selectNewBooks();

    Page<Book> searchBooks(Book book);

    Integer editBook(Book book);

    @Select("select * from book where book_id = #{id}")
    @ResultMap("bookMap")   // 封装结果集
    Book findById(String id);

    //新增图书
    Integer addBook(Book book);

    // 管理员的当前借阅
    Page<Book> selectBorrowed(Book book);
    // 普通用户的当前借阅
    Page<Book> selectMyBorrowed(Book book);
}
